console.log('1');//1
//1 4 7 11 6 5 8 12 2 3 9 10
setTimeout(() => {
  console.log('2');//8
  process.nextTick(() => {
    console.log('3');//9
  });
});

new Promise((resolve) => {
  console.log('4');//2
  resolve();
}).then(() => {
  console.log('5');//5
});

process.nextTick(() => {
  console.log('6');//4
});

new Promise((resolve) => {
  console.log('7');//3
  resolve();
}).then(() => {
  console.log('8');//6
});

setTimeout(() => {
  console.log('9');//10
  process.nextTick(() => {
    console.log('10');//11
  });
});

new Promise((resolve) => {
  console.log('11');//4
  resolve();
}).then(() => {
  console.log('12');//7
});